<template>
	<div class="footer-guide">
		<!-- 绑定类名写法一 -->
		<router-link to="home" :class="['guide-item', '/home' === $route.path ? 'on' : '']">
			<span class="item-icon">
				<i class="iconfont icon-fuwuzhongxin"></i>
			</span>
			<span>外卖</span>
		</router-link>
		<!-- 绑定类名写法二 -->
		<router-link to="search" class="guide-item" :class="{on : '/search' === $route.path}">
				<span class="item-icon">
					<i class="iconfont icon-icon-search"></i>
				</span>
				<span>搜索</span>
		</router-link>
		<router-link to="order" :class="['guide-item', '/order' === $route.path ? 'on' : '']">
				<span class="item-icon">
					<i class="iconfont icon-dingdan"></i>
				</span>
				<span>订单</span>
		</router-link>
		<router-link to="profile" :class="['guide-item', '/profile' === $route.path ? 'on' : '']">
				<span class="item-icon">
					<i class="iconfont icon-gerenzhongxinwoderenwubiaozhuntoumianxing"></i>
				</span>
				<span>我的</span>
		</router-link>
	</div>
</template>

<script>
	export default {}
</script>

<style lang="less" scoped>
	.footer-guide{
		position: fixed;
		z-index: 100;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		height: 50px;
		border-top: 1px solid #e4e4e4;
		background-color: #fff;
		display: flex;
		
	}
	
	.guide-item{
		display: block;
		flex: 1;
		text-align: center;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin: 5px;
		color: #999;
		
		&.on{
			color: #02a774;
		}
		
		span{
			font-size: 12px;
			margin-top: 2px;
			margin-bottom: 2px;
			
			.iconfont{
				font-size: 22px;
			}
		}
	}
</style>
